﻿var EmptyGuid = '00000000-0000-0000-0000-000000000000';

function RefreshPage(arg) {
    //        Refresh();

    var type = parseInt(arg); ////本页刷新变量为true，审核页面返回1
    if (type == 1) {
        top.ChildDialogCallBack = "Refresh";
        top.ChildDialogClose(1);


    } else {
        Refresh();
    }
}
//begin 2013-12-4
//取得上传验证图片列表
function GetCheckImg() {
    // sysCode = "";
    funcCode = "";
    $("#divImages img[checkempty='yes']").each(function () {
        //  sysCode += $(this).attr("syscode") + ",";
        funcCode += $(this).attr("FuncCode") + ",";
    });
    return funcCode;
}
///取得未上传图片名
function GetCheckImgTitle(code) {
    var result = "";
    if (code.length > 0) {
        $("#divImages img[FuncCode='" + code + "']").each(function () {
            result = $(this).attr("title");
        });
    }
    return result;
}
//end

$(function () {

    ////导出pdf
    $("#btnDownPdf").click(function () {
        var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
        window.open("../Handlers/PdfDownHandler.ashx?userGuid=" + corpUserGuid + "&functype=getCorpInspectPdf");
    });

    /*地区控件在IE7下移动问题解决*/
    $("#RAD_SPLITTER_PANE_CONTENT_rpRight").css("position", "relative");

    $("#save").click(function () {
        var dataValid = CheckControlValid("save");
        if (!dataValid) {
            return false;
        }
        //取得验证图片begin
        var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
        var funcCode = GetCheckImg();
        //end
        var dataStr = GetData("save");
        //$.getJSON方法为get传值，如果数据量过大则会失效，使用post传值则会避免此问题
        $.post("../Handlers/EnterpriseCorpInfoHandler.ashx",
            { "action": "Add", "data": dataStr, "funcCode": funcCode, "corpGuid": corpUserGuid, "rand": Math.random() },
            function (data) {
                var result = eval(data);
                if (result.Result == true) {
                    radalert(result.Message, 300, 150, '提示', RefreshPage);
                    return;
                }
                else {
                    //未上传的图片
                    if (data.Message == "img") {
                        var text = GetCheckImgTitle(data.ReturnValue);
                        $.ligerDialog.alert(text + "必须上传！");
                        return false;
                    }
                    $.ligerDialog.alert(result.Message);
                    return;
                }
            },
            "json"
        );
    });
    $("#Post").click(function () {
        //$.getJSON方法为get传值，如果数据量过大则会失效，使用post传值则会避免此问题
        radconfirm('确定上报企业信息，上报后信息不可修改？', Post, 300, 150, null, '提示');
        return false;
        function Post(arg) {

            if (arg) {
                ////先执行一次保存方法，可能填写完数据直接点击上报，此时数据尚未保存
                var dataStr = GetData("Post");
                $.ajax({
                    data: { "action": "Add", "data": dataStr, "rand": Math.random() },
                    url: "../Handlers/EnterpriseCorpInfoHandler.ashx",
                    async: false, ////同步调用
                    type: "post",
                    dataType: "json",
                    success: function (data) {
                        if (data.Result == true) {
                            //取得验证图片begin
                            var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
                            var funcCode = GetCheckImg();
                            //end
                            $.ajax({
                                data: { "action": "Post", "funcCode": funcCode, "corpGuid": corpUserGuid, "rand": Math.random() },
                                url: "../Handlers/EnterpriseCorpInfoHandler.ashx",
                                async: false,
                                type: "get",
                                dataType: "json",
                                success: function (data) {
                                    if (data.Result == true) {
                                        radalert(data.Message, 300, 150, '提示', RefreshPage);
                                        return;
                                    }
                                    else {//未上传的图片
                                        if (data.Message == "img") {
                                            var text = GetCheckImgTitle(data.ReturnValue);
                                            $.ligerDialog.alert(text + "必须上传！");
                                            return false;
                                        }
                                        $.ligerDialog.alert(data.Message);
                                        return;
                                    }
                                }
                            });
                        }
                        else {

                            $.ligerDialog.alert(data.Message);
                            return;
                        }
                    }
                }
                );
            }
        }
    }
    );
    $("#CancelPost").click(function () {
        //$.getJSON方法为get传值，如果数据量过大则会失效，使用post传值则会避免此问题
        radconfirm('确定取消上报信息？', Post, 300, 150, null, '提示');
        return false;
        function Post(arg) {
            $.ajax({
                data: { "action": "CancelPost", "rand": Math.random() },
                url: "../Handlers/EnterpriseCorpInfoHandler.ashx",
                async: false,
                type: "get",
                dataType: "json",
                success: function (data) {
                    if (data.Result == true) {
                        radalert(data.Message, 300, 150, '提示', RefreshPage);
                        return;
                    }
                    else {
                        $.ligerDialog.alert(data.Message);
                        return;
                    }
                }
            });
        }
    }
    );
    $("#Audit").click(function () {
        var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
        //top.ChildDialog = top.$.ligerDialog.open({ url: "../Enterprise/EnterpriseAudit.aspx?corpGuid=" + corpUserGuid + "&rand=" + Math.random(), width: 820, height: 420, title: '', isResize: true });
        $.ligerDialog.open({ url: "../Enterprise/EnterpriseAudit.aspx?corpGuid=" + corpUserGuid + "&rand=" + Math.random(), width: 820, height: 420, title: '', isResize: true });
        //top.ChildDialogWin = window;
        return false;
    }
    );
    /*资质添加按钮点击事件*/
    $("#CorpQualityAdd").click(function () {

        top.ChildDialog = top.$.ligerDialog.open({ url: "Enterprise/EnterpriseQualityInfo14.aspx?OperateType=Add&rand=" + Math.random(), width: 820, height: 590, title: '', isResize: true });
        top.ChildDialogWin = window;
        return false;
    }
    );
    /*资质编辑按钮点击事件*/
    $("#CorpQualityEdit").click(function () {
        //获取选中的资质
        var checkedQualities = $("#CorpQualities input:checked");
        var count = checkedQualities.length;
        if (count < 1) {
            $.ligerDialog.alert('请先选择需要编辑的资质');
            return false;
        }
        else if (count > 1) {
            $.ligerDialog.alert('您选择的资质超过了一项，请选择一项进行编辑');
            return false;
        }
        else {
            var guid = checkedQualities.attr("id");
            // window.radopen("EnterpriseQualityInfo.aspx?OperateType=Edit&QualityGuid=" + guid + "&rand=" + Math.random(), "radWindowQuality");
            top.ChildDialog = top.$.ligerDialog.open({ url: "Enterprise/EnterpriseQualityInfo14.aspx?OperateType=Edit&QualityGuid=" + guid + "&rand=" + Math.random(), width: 820, height: 590, title: '', isResize: true });
            top.ChildDialogWin = window;
            return false;
        }
    }
    );
    /*资质删除按钮点击事件*/
    $("#CorpQualityDel").click(function () {
        //获取选中的资质
        var checkedQualities = $("#CorpQualities input:checked");
        var count = checkedQualities.length;
        if (count < 1) {
            $.ligerDialog.alert('请先选择需要删除的资质');
            return false;
        }
        else {
            radconfirm('确定删除？', DeleteQualities, 300, 150, null, '提示');
            return false;
        }

    }
    );
    /*扫描件上传空间事件*/
    $(".corpImages[except!='except'] button").each(function () {
        var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
        var sysCode = $(this).attr("sysCode");
        var funcCode = $(this).attr("FuncCode");
        $(this).click(function () {
            // window.radopen("../Person/PersonUploadFile.aspx?filename=" + corpUserGuid + "&FuncCode=" + funcCode, "radWindowUpload");
            $.ligerDialog.open({ url: "../UserControl/FileUploadList.aspx?filename=" + corpUserGuid + "&FuncCode=" + funcCode, width: 650, height: 570, title: '', isResize: true });
            return false;
        });
    });

    BindQuality();
    BindManager();
    BindImage();

    var editModel = $("#ContentPlaceHolder1_hdnEditModel").val();
    var CurrentEmbranchEditModel = $("#ContentPlaceHolder1_hdnCurrentEmbranchEditModel").val();
    if (editModel == "1") {
        SetControlEditById(editModel, "tb_Corp_Companyinfo");
        SetControlEditById(editModel, "ContentPlaceHolder1_divSecurityCode");

        $("#CorpQualityAdd").hide();
        $("#CorpQualityEdit").hide();
        $("#CorpQualityDel").hide();
        ////不可编辑则提供查看功能
        //        $(".corpImages button").each(function () {
        //            $(this).hide();
        //        });
        ////不可编辑则提供查看功能2013-12-4
        var editPicModel = $("#ContentPlaceHolder1_hdnCanUploadPic").val();
        if (editPicModel == "0") {
            $(".corpImages button").each(function () {
                $(this).hide();
            });
        } //end
    }

    if (CurrentEmbranchEditModel == "1") {
        SetControlEditById(editModel, "ContentPlaceHolder1_divEmbranchment");
    }
    else {
        //外地准入扫描件可上传
        $(".corpImages button[funccode='CorpWDZR']").show();
    }
    $("#ContentPlaceHolder1_txtBussinessArea,#ContentPlaceHolder1_txtIntroduction").keyup(function () {
        TextMaxLength(this, 500);
    })
    $(".input_mm i a[except!='except']").each(function () {
        var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
        var imgObj = $(this);
        var sysCode = imgObj.attr("sysCode");
        var funcCode = imgObj.attr("FuncCode");
        imgObj.click(function () {
            top.$.ligerDialog.open({ url: "Enterprise/UploadFileShowList.aspx?filename=" + corpUserGuid + "&funcCode=" + funcCode + "&sysCode=" + sysCode + "&fileType=.jpg", width: 820, height: 650, title: '', isResize: true, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            return false;
        }
        );
    }
    );
    $(".tishi_tt_t cite").addClass("pointer");
    $(".tishi_tt_t cite").click(function () {
        $("#PromptMain").toggle();
    }
    );
    //外地准入图片
    BindCorpWdzr();
    //外地准入上传按钮
    BindCorpWdzrButton();
}
);
function BindQuality() {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    $.getJSON("../Handlers/EnterpriseQualityInfoHandler.ashx", { "action": "Get", "data": corpUserGuid, "rand": Math.random() }, function (data) {
        var result = eval(data);
        var innerHTML = "";
        $("#CorpQualities").empty();
        var editModel = $("#ContentPlaceHolder1_hdnEditModel").val();
        if (data != null && data.length > 0) {
            for (var i = 0, j = data.length; i < j; i++) {
                var item = data[i];
                if (item.IsMain != null && item.IsMain == true) {
                    //绑定资质证书编号
                    $("#ContentPlaceHolder1_txtQualityCode").val(item.QualityCode);
                }
                innerHTML += ' <tr><td><input  type="checkbox" id="' + item.QualityGuid + '"/></td>';

                ////不可编辑则提供查看功能
                if (editModel == "1") {
                    var url = "<a href='javascript:void(0);' onclick='QualityDetail(\"" + item.QualityGuid + "\",\"" + item.CorpUserGuid + "\")'><span style=\"color: #43a9f5\">" + item.DetailName + "</span></a>";
                    innerHTML += '<td>' + (i + 1).toString() + '</td><td>' + url + '</td><td>'
                        + item.QualityCode + '</td><td>'
                        + item.GradeName + '</td><td>' + GetIsMain(item.IsMain) + '</td> <td>'
                        + GetString(item.GetDate).substr(0, GetString(item.GetDate).indexOf('T')) + '</td><td>'
                        + '--'//GetString(item.zzzEndDate).substr(0, GetString(item.zzzEndDate).indexOf('T'))
                        + '</td></tr>';
                }
                else {
                    innerHTML += '<td>' + (i + 1).toString() + '</td><td>' + item.DetailName + '</td><td>'
                        + item.QualityCode + '</td><td>'
                        + item.GradeName + '</td><td>' + GetIsMain(item.IsMain) + '</td> <td>'
                        + GetString(item.GetDate).substr(0, GetString(item.GetDate).indexOf('T')) + '</td><td>'
                        + '--'//GetString(item.zzzEndDate).substr(0, GetString(item.zzzEndDate).indexOf('T'))
                        + '</td></tr>';
                }
            }
        }
        $("#CorpQualities").append(innerHTML);
    });
    //BindCorpZZImage();
}
function BindManager() {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    $.getJSON("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "GetManager", "data": corpUserGuid, "rand": Math.random() }, function (data) {
        var result = eval(data);
        var innerHTML = "";
        var isShowEmp = $("#ContentPlaceHolder1_hdnIsShowEmp").val();
        $("#CorpManagers").empty();
        if (data != null && data.length > 0) {
            for (var i = 0, j = data.length; i < j; i++) {
                var item = data[i];
                innerHTML += '<tr id=' + item.EmpGuid + '><td>' + (i + 1).toString() + '</td><td>' + GetString(item.Name) + '</td><td>' + item.TypeFlagTitle + '</td><td>' + GetIdTypeTitle(item.IDType) + '</td> <td>' + GetString(item.IDCard) + '</td><td>' + GetString(item.Tel) + '</td><td>' + GetString(item.MobileTel) + "</td>";
                var editModel = $("#ContentPlaceHolder1_hdnEditModel").val();
                var currentEditModel = $("#ContentPlaceHolder1_hdnCurrentEmbranchEditResult").val();
                var canEdit = "";
                if (item != null && item.CorpFlowCode != null) {
                    canEdit = item.CorpFlowCode.substr(0, 1);
                }
                if (currentEditModel != "1" && canEdit != "1") {
                    innerHTML += "<td><div class='tdi-con'><img src='../images/addicon.jpg' class='pointer' onclick='ManagerAdd(\"" + item.EmpGuid + "\", " + item.TypeFlag + ")'  width='17' height='16' alt='添加' title='添加' /><img src='../images/editicon.jpg' opt='Edit' class='pointer' onclick='ManagerEdit(\"" + item.EmpGuid + "\", " + item.TypeFlag + ")' width='17' height='16' alt='修改' title='修改' /><img src='../images/deleteicon.jpg' opt='Del' class='pointer' onclick='ManagerDel(\"" + item.EmpGuid + "\"," + item.TypeFlag + ")' width='17' height='16' alt='删除' title='删除' /></div></td>";
                }
                else {
                    if (item.EmpGuid != null && item.EmpGuid != EmptyGuid && isShowEmp == "1") {
                        //                        innerHTML += "<td><a href='javascript:void(0);' onclick='ManagerDetail(\"" + item.EmpGuid + "\", " + item.TypeFlag + ")'>查看</a></td>";
                        innerHTML += "<td><img src='../images/magnifying.jpg' class='pointer' onclick='ManagerDetail(\"" + item.EmpGuid + "\", " + item.TypeFlag + ")'  width='17' height='16' alt='查看' title='查看' /></td>";
                    }
                    else {
                        innerHTML += "<td></td>";
                    }
                }
                innerHTML += "</tr>";
            }
        }
        $("#CorpManagers").append(innerHTML);


    });
}
function GetIsMain(isMain) {
    var title = "否";
    if (isMain != null && isMain == true) {
        title = "是";
    }
    return title;
}

function GetIdTypeTitle(idType) {
    switch (idType) {
        case "1":
            return "身份证";
        case "2":
            return "军官证";
        case "3":
            return "护照";
        default: return "";
    }
}

function DeleteQualities(arg) {
    if (arg) {
        var checkedQualities = $("#CorpQualities input:checked");
        var count = checkedQualities.length;
        var qualities = "";
        for (var i = 0; i < count; i++) {
            var guid = checkedQualities[i].id;
            qualities += guid + ',';
        }
        $.getJSON("../Handlers/EnterpriseQualityInfoHandler.ashx", { "action": "Delete", "data": qualities, "rand": Math.random() }, function (data) {
            var result = eval(data);
            $.ligerDialog.alert(result.Message);
            BindQuality();
        });
    }
}

function DeleteManagers(arg) {
    var checkedManagers = $("#CorpManagers input:checked");
    var count = checkedManagers.length;
    var managers = "";

}

function GetString(obj) {
    if (obj == null || obj == undefined) {
        return '';
    }
    return obj;
}

function ManagerAdd(guid, type) {
    if (guid == null || guid == undefined || guid == EmptyGuid) {
        //window.radopen("../Person/PersonManagerInfo.aspx?typeFlag=" + type + "&rand=" + Math.random(), "radWindowManager");
        top.ChildDialog = top.$.ligerDialog.open({ url: "Person/PersonManagerInfo.aspx?typeFlag=" + type + "&rand=" + Math.random(), width: 1080, height: 800, title: '', isResize: true, showClose: false, buttons: [{ text: '关闭', onclick: function (item, dialog) { BindManager(); dialog.close(); } }] });
        top.setChildDialogClose(this, "BindManager");
        top.ChildDialogWin = this;
        return false;
    }
    else {
        $.ligerDialog.alert('该类型管理人员已存在不能重复添加');
        return false;
    }
}

function ManagerEdit(guid, type) {
    if (guid == null || guid == undefined || guid == EmptyGuid) {
        $.ligerDialog.alert('修改失败：该类型管理人员尚未存在');
        return false;
    }
    else {
        //  window.radopen("../Person/PersonManagerInfo.aspx?typeFlag=" + type + "&empGuid=" + guid +"&rand=" + Math.random(), "radWindowManager");
        top.ChildDialog = top.$.ligerDialog.open({ url: "Person/PersonManagerInfo.aspx?typeFlag=" + type + "&empGuid=" + guid + "&rand=" + Math.random(), width: 1080, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { BindManager(); dialog.close(); } }] });
        top.ChildDialogWin = window;
        return false;
    }
}
function ManagerDetail(guid, type) {
    if (guid == null || guid == undefined || guid == EmptyGuid) {
        $.ligerDialog.alert('修改失败：该类型管理人员尚未存在');
        return false;
    }
    else {
        // window.radopen("../Person/PersonManagerInfo.aspx?typeFlag=" + type + "&empGuid=" + guid + "&opt=1" + "&rand=" + Math.random(), "radWindowManager");
        top.ChildDialog = top.$.ligerDialog.open({ url: "Person/PersonManagerInfo.aspx?typeFlag=" + type + "&empGuid=" + guid + "&opt=1" + "&rand=" + Math.random(), width: 1080, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        top.ChildDialogWin = window;
        return false;
    }
}
function ManagerDel(guid, type) {
    if (guid == null || guid == undefined || guid == EmptyGuid) {
        $.ligerDialog.alert('删除失败：该类型管理人员尚未存在');
        return false;
    }
    else {

        radconfirm('确定删除？', DeleteManager, 300, 150, null, '提示');
        return false;
    }
    function DeleteManager(arg) {
        if (arg) {
            $.getJSON("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "DelManager", "data": guid, "typeFlag": type, "rand": Math.random() }, function (data) {
                if (data.Result) {
                    $.ligerDialog.alert(data.Message);
                    BindManager();
                }
                else {
                    $.ligerDialog.alert(data.Message);
                }
            });
        }
    }
}

function QualityDetail(qualityGuid, corpUserGuid) {
    top.ChildDialog = top.$.ligerDialog.open({ url: "Enterprise/EnterpriseQualityInfo14.aspx?OperateType=Edit&QualityGuid=" + qualityGuid + "&CorpUserGuid=" + corpUserGuid + "&rand=" + Math.random(), width: 820, height: 590, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
    top.ChildDialogWin = window;
    //  window.radopen("EnterpriseQualityInfo.aspx?OperateType=Edit&QualityGuid=" + qualityGuid + "&CorpUserGuid=" + corpUserGuid + "&rand=" + Math.random(), "radWindowQuality");
    return false;
}

Date.prototype.format = function (format) {
    var o = {
        "M+": this.getMonth() + 1, //month
        "d+": this.getDate(),    //day
        "h+": this.getHours(),   //hour
        "m+": this.getMinutes(), //minute
        "s+": this.getSeconds(), //second
        "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter
        "S": this.getMilliseconds() //millisecond
    }
    if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
 (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o) if (new RegExp("(" + k + ")").test(format))
        format = format.replace(RegExp.$1,
 RegExp.$1.length == 1 ? o[k] :
 ("00" + o[k]).substr(("" + o[k]).length));
    return format;
}

function DateFormat(obj) {
    if (obj == null || obj == undefined || obj == '') {
        return "";
    }
    try {
        var objDate = new Date(obj);
        return objDate.format("yyyy-M-dd");
    }
    catch (ex) {
        return "";
    }
}
function OnClientCloseImg(args) {
    var arg = args;
    if (arg) {
        if (arg.Result == 1) {
            return;
        }
        AfterUpload();
    }
}
function AfterUpload() {
    BindImage();
    BindCorpWdzr();
}

function BindImage() {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    //排除主项资质的绑定[except!='except']
    $(".corpImages[except!='except'] img").each(function () {
        var imgObj = $(this);
        var sysCode = imgObj.attr("sysCode");
        var funcCode = imgObj.attr("FuncCode");
        imgObj.attr("src", "../Handlers/GetFileHandler.ashx?fileName=" + corpUserGuid + ".jpg&sysCode=" + sysCode + "&funcCode=" + funcCode + "&rand=" + Math.random());
        imgObj.show();
        imgObj.click(function () {
            top.$.ligerDialog.open({ url: "Enterprise/UploadFileShowList.aspx?filename=" + corpUserGuid + "&funcCode=" + funcCode + "&sysCode=" + sysCode + "&fileType=.jpg", width: 820, height: 650, title: '', isResize: true, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            return false;
        }
        );

    }
);

}

function TextMaxLength(control, maxlength) {
    var text = control.value;
    if (text.length > maxlength) {
        control.value = text.substring(0, maxlength);
        alert("超出了最大字数");
    }
}

function BindCorpZZImage() {
    $(".corpImages[type='quality']").remove();
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    $.post("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "GetCorpZZImage", "data": corpUserGuid, "rand": Math.random() }, function (data) {
        var result = eval(data);
        var mainQaulityGuid;
        if (result != null && result.length > 0) {
            var obj = $("#divImages");
            for (var i = 0; i < result.length; i++) {
                var item = result[i];
                var qualityGuid = item.QualityGuid;
                if (item.IsMain) {
                    mainQaulityGuid = item.QualityGuid;
                }
                var qualityName = item.DetailName;
                var src = "../Handlers/GetFileHandler.ashx?fileName=" + qualityGuid + ".jpg&sysCode=EF&funcCode=CorpZZ&rand=" + Math.random();
                var zzImage = "<div class='corpImages' except='except' type='quality'><img  Class='pointer' src='" + src + "' onclick='ShowZZImage(\"" + qualityGuid + "\")' />" +
                "<div class='corpImagesTitle'><span>" + qualityName + "</span></div>" +
                "</div>";
                $("#divImages").append(zzImage);

            }

        }
        $("#QualityCodeImg").bind("click", function () {
            ShowZZImage(mainQaulityGuid);
        });
    }, "json"
    );
}

function ShowZZImage(qualityGuid) {
    top.$.ligerDialog.open({ url: "Enterprise/UploadFileShowList.aspx?filename=" + qualityGuid + "&funcCode=CorpZZ&sysCode=EF&fileType=.jpg", width: 820, height: 650, title: '', isResize: true, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
}

function showPromptDetail() {
    $("#PromptMain").toggle();
}
//外地准入扫描件
function BindCorpWdzr() {
    var embranchGid = $("#ContentPlaceHolder1_hdnEmbranchGid").val();
    if (embranchGid != null && embranchGid != '') {
        var imgObj = $(".corpImages img[funccode='CorpWDZR']");
        var sysCode = imgObj.attr("sysCode");
        var funcCode = imgObj.attr("FuncCode");
        imgObj.attr("src", "../Handlers/GetFileHandler.ashx?fileName=" + embranchGid + ".jpg&sysCode=" + sysCode + "&funcCode=" + funcCode + "&rand=" + Math.random());
        imgObj.show();
        imgObj.click(function () {
            top.$.ligerDialog.open({ url: "Enterprise/UploadFileShowList.aspx?filename=" + embranchGid + "&funcCode=" + funcCode + "&sysCode=" + sysCode + "&fileType=.jpg", width: 820, height: 650, title: '', isResize: true, buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            return false;
        }
        );
    }
}
//外地准入上传按钮
function BindCorpWdzrButton(embranchGid) {
    var obj = $(".corpImages button[funccode='CorpWDZR']");
    var corpUserGuid = $("#ContentPlaceHolder1_hdnEmbranchGid").val();
    var sysCode = obj.attr("sysCode");
    var funcCode = obj.attr("FuncCode");
    obj.click(function () {
        // window.radopen("../Person/PersonUploadFile.aspx?filename=" + corpUserGuid + "&FuncCode=" + funcCode, "radWindowUpload");
        $.ligerDialog.open({ url: "../UserControl/FileUploadList.aspx?filename=" + corpUserGuid + "&FuncCode=" + funcCode, width: 650, height: 570, title: '', isResize: true });
        return false;
    });
}

/*打开添加窗口*/
function ShowUpForm(u, w, h, win) {
    win = win || this;
    $.ligerDialog.open({ url: u, width: w, height: h, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
    win.ChildDialogWin = this;
    return false;
}


var navtab = null;
$(function () {
    var tab = $("#tabcontainer").ligerTab();
    navtab = $("#tabcontainer").ligerGetTabManager();

});
//显示人员证书审核列表
function EmpCertsListView(groupId, title) {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    var urlStr = "../Person/PersonEmpAuditList14.aspx?corpUserGuid=" + corpUserGuid + "&groupId=" + groupId;
    navtab.addTabItem({ url: urlStr, text: title, height: 620 });
}
//显示人员职称审核列表
function EmpPostsListView(title) {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    var urlStr = "../Person/PersonEmpAuditListForPost14.aspx?corpUserGuid=" + corpUserGuid + "&ispost=1";
    navtab.addTabItem({ url: urlStr, text: title, height: 620 });
}
//显示全部人员列表
function EmpAllListView(title) {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    var urlStr = "../Person/PersonEmpListShow.aspx?corpUserGuid=" + corpUserGuid;
    navtab.addTabItem({ url: urlStr, text: title, height: 620 });
}
//显示机械设备列表
function CorpMachineListView(title) {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    var urlStr = "../Enterprise/EnterpriseMachineInfoList.aspx?corpUserGuid=" + corpUserGuid;   
    navtab.addTabItem({ url: urlStr, text: title, height: 620 });
}
//显示企业财务列表
function CorpFinancialInfoListView(title) {
    var corpUserGuid = $("#ContentPlaceHolder1_hdnCorpUserguid").val();
    var urlStr = "../Enterprise/EnterpriseFinancialInfoList.aspx?corpUserGuid=" + corpUserGuid;
    navtab.addTabItem({ url: urlStr, text: title, height: 620 });
}